package top.market.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 商品
 * </p>
 *
 * @author li yuhai
 * @since 2025-03-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("product")
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @TableField("name")
    private String name;

    /**
     * 商品分类id
     */
    @TableField("category_id")
    private Long categoryId;

    /**
     * 商品剩余数量
     */
    @TableField("type")
    private Integer type;

    /**
     * 商品剩余数量
     */
    @TableField("remaining_number")
    private Long remainingNumber;


    /**
     * 商品价格
     */
    @TableField("price")
    private BigDecimal price;

    /**
     * 第三方图片地址
     */
    @TableField("image")
    private String image;

    /**
     * 描述信息
     */
    @TableField("description")
    private String description;

    /**
     * 0 停售 1 起售
     */
    @TableField("status")
    private Integer status;

    /**
     * 卖出的数量
     */
    @TableField("sell_number")
    private Long sellNumber;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String CATEGORY_ID = "category_id";

    public static final String REMAINING_NUMBER = "remaining_number";

    public static final String PRICE = "price";

    public static final String IMAGE = "image";

    public static final String DESCRIPTION = "description";

    public static final String STATUS = "status";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

}
